<template>
  <div class="anchor-card">
    <div class="wrap">
      <div class="anchor-img">
        <img :src="src" />
      </div>
      <div class="anchor-text">
        <div class="anchor-text-name">{{ name }}</div>
        <div class="anchor-text-intrudce">{{ intrudce }}</div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, computed } from 'vue'

const props = {
  src: {
    type: String
  },
  name: {
    type: String
  },
  intrudce: {
    type: String
  }
}

export default defineComponent({
  props,
  setup(props) {
    const src = computed(() => props.src)
    const name = computed(() => props.name)
    const intrudce = computed(() => props.intrudce)

    return {
      src,
      name,
      intrudce
    }
  }
})
</script>

<style scoped lang="less">
.anchor-card {
  width: 100%;
  margin-bottom: 10px;
  .wrap {
    width: 100%;
    display: flex;
    .anchor-img {
      width: 40px;
      height: 40px;
      cursor: pointer;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .anchor-text {
      flex: 1;
      padding: 2px 5px;
      .anchor-text-name {
        font-size: 10px;
        font-weight: 600;
        transform: scale(0.9);
        font-weight: lighter;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        &:hover {
          cursor: pointer;
          text-decoration: underline;
        }
      }
      .anchor-text-intrudce {
        font-size: 10px;
        transform: scale(0.9);
        font-weight: lighter;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
}
</style>
